<%@page import="com.is.control.*"%>
<%@page import="com.is.model.Evaluation"%>
<%@page import="com.is.util.ParamUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.DesData"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<script type="text/javascript" src="../../resources/js/jquery.artDialog.js"></script>
<title>学生综合评价</title>
</head>
<body>
<%

        Evaluation e = new Evaluation();
       // DesData des = new DesData();
        e.setStuId(ParamUtil.getInt(request, "stuId"));
        e.setStuyear(ParamUtil.getInt(request,"stuyear"));
        e.setComments(ParamUtil.getString(request, "comments","未填写"));
        e.setRecords(ParamUtil.getString(request, "records","未填写"));
        e.setScore(ParamUtil.getString(request,"score","未填写"));
        e.setLevel(ParamUtil.getString(request, "level","未填写"));
        DesData des = new DesData();
        String classId = des.encrypt(StudentControl.getStudent(ParamUtil.getInt(request, "stuId")).getClassId());
        if(EvaluationControl.insertEvaluation(e)){
        %>
        <script>
        $.dialog({
		    title: '综合评价',
		    content: '系统已记录您录入的学生信息,将返回到学生列表',
		    icon: 'succeed',
		    ok: function(){
        			window.location.href='students_all.jsp?classId=<%=classId%>';
		    }
		});
        </script>
        <%
        }else{
        %>
        <script>
        $.dialog({
		    title: '综合评价',
		    content: '抱歉，系统出错或您录入的信息有误，请重试',
		    icon: 'warning',
		    ok: function(){
        		history.go(-1);
		    }
		});
      //  alert("抱歉，系统出错或您录入的信息有误，请重试");
       // history.go(-1);
        </script>
        <% }
 %>
</body>
</html>